<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Vue中的列表渲染</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <!-- <div id="app">
        <template v-for="(item, index) of list">
            <div>
                {{index}}-{{item.id}}
            </div>
            <span>{{item.text}}</span>
        </template>
        
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                list: [
                    {id: "001", text: "hello"},
                    {id: "002", text: "world"},
                    {id: "003", text: "Jhon"}
                ]
            }
        });
    </script> -->

    <!-- 对象循环 -->
    <div id="app">
        <div v-for="(item, key, index) of userInfo">
            {{item}}--{{key}}--{{index}}
        </div>
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                userInfo: {
                    name: "Dell",
                    age: 28,
                    gendor: "male",
                    salary: "secret"
                }
            }
        });
    </script>
</body>
</html>